package com.freshcity.page.home
{
	import com.freshcity.common.EnergyBarBack;
	import com.freshcity.component.container.Component;
	
	import flash.display.DisplayObjectContainer;
	
	public class EnergyBar extends Component
	{
		private var _data:int;
		private var back:EnergyBarBack;
		
		public function EnergyBar(parent:DisplayObjectContainer=null, xpos:Number=0, ypos:Number=0)
		{
			super(parent, xpos, ypos);
		}
		
		override protected function addChildren():void
		{
			super.addChildren();
			back = new EnergyBarBack();
			addChild(back);
		}
		
		override public function destroy():void
		{
			super.destroy();
		}

		public function get data():int
		{
			return _data;
		}

		public function set data(value:int):void
		{
			_data = value;
			//var t:int = back.energyRender.totalFrames;
			//back.energyRender.gotoAndStop(t-int(_data/100*t));
			back.energyValue.text = _data + "/" + 100;
		}

	}
}